import VueRouter from "vue-router"
import Login from '@/pages/Login'
import NotFound from '@/pages/NotFound'

import roleRoutes from './modules/role'
// import permissionRoutes from './modules/permission'

//业务路由
const centerRoutes = {
  path: '/',
  component: () => import('@/pages/Index'),
  children: []
}

centerRoutes.children.push.apply(centerRoutes.children, roleRoutes)
// centerRoutes.children.push.apply(centerRoutes.children, permissionRoutes)

const routes = []
//登录
routes.push({
  path: '/login',
  component: Login
})
//404
routes.push({
  path: '*',
  component: NotFound
})

routes.push(centerRoutes)

const router = new VueRouter({
  mode: 'history',
  routes
})

export default router
